package org.jetlinks.community.mstn.entity.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jetlinks.community.auth.entity.OrganizationEntity;
import org.jetlinks.community.auth.enums.OrgType;
import org.jetlinks.community.auth.enums.RoleState;

import java.util.Map;

@Data
public class SiteListResVO {
    @Schema(description = "机构ID(只能由数字,字母,下划线和中划线组成)")
    private String id;

    @Schema(description = "编码")
    private String code;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "类型")
    private String type;

    @Schema(description = "机构类型。 system为系统 其他参考enum")
    private OrgType orgType;

    @Schema(description = "项目类型")
    private String projectType;

    @Schema(description = "项目状态。enabled为正常，disabled为已禁用")
    private RoleState projectState;


    @Schema(description = "说明")
    private String describe;

    @Schema(description = "其他配置")
    private Map<String, Object> properties;

    @Schema(description = "其他配置")
    private String logId;
    public static SiteListResVO of(OrganizationEntity entity) {
        SiteListResVO vo = new SiteListResVO();
        vo.setId(entity.getId());
        vo.setCode(entity.getCode());
        vo.setName(entity.getName());
        vo.setType(entity.getType());
        vo.setOrgType(entity.getOrgType());
        vo.setDescribe(entity.getDescribe());
        vo.setProjectType(entity.getProjectType());
        vo.setProjectState(entity.getProjectState());
        vo.setProperties(entity.getProperties());
        return vo;
    }
}
